﻿using System;
using System.Threading.Tasks;
using AutoMapper;
using EfConsole.Services;
using Microsoft.Extensions.DependencyInjection;

namespace EfConsole
{
    class Program
    {
        async static Task Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            var sc = new ServiceCollection();
            sc.AddScoped<ITestService, TestService>();
            sc.AddDbContext<TestContext>();
            sc.AddAutoMapper(typeof(Program).Assembly);

            var provider = sc.BuildServiceProvider();

            using (var scope = provider.CreateScope())
            {
                var service = scope.ServiceProvider.GetService<ITestService>();
                service.InitDatabase();


                var res = await service.AddProfileAsync(new Profile
                {
                    Id = Guid.NewGuid().ToString(),
                    AccountId = Guid.NewGuid().ToString(),
                    Type = ProfileType.PublicProfile,
                    Name = "Test profile",
                    Description = "Test Description",
                    ContentType = ProfileContentType.ExportLocation,
                    Content = new ExportLocationProfileContent
                    {
                        ContainerName = "Test Container",
                        SASConnection = "TEst SAs"
                    }
                });

                //var p = await service.GetProfileAsync("2df62e4c-4030-4c90-9513-e5efdc33672e");

                Console.WriteLine(12312);
            }

        }
    }
}
